package com.itlong.cloud.project.property;

import com.itlong.cloud.POJO.DTO.property.*;
import com.itlong.cloud.POJO.PO.RoomInfoPO;
import com.itlong.cloud.POJO.VO.app.AppElevatorMealPayRecordVO;
import com.itlong.cloud.POJO.VO.miniprogram.MiniProgramPassRoomListVO;
import com.itlong.cloud.POJO.VO.property.PropertyProjectMinAvaliableRoomInfoVO;
import com.itlong.cloud.POJO.VO.property.PropertyProjectRoomInfoVO;
import com.itlong.cloud.POJO.VO.property.PropertyProjectRoomSimpleInfoVO;
import com.itlong.cloud.utils.page.Page;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;
import java.util.Map;

/**
 * <desc>
 *      房屋信息服务接口协议提供对象.
 * </desc>
 *
 * @createDate 2017-09-29
 */
@FeignClient(name = "project-service")
public interface IPropertyRoomInfoServiceClient {

    /**
     * <desc>
     *      保存单个房间信息
     * </desc>
     *
     * @param propertyProjectSaveRoomInfoDTO 添加房间信息数据传输对象
     * @return  受影响的行数
     * @author LouisLewis
     * @createDate 2017-09-29
     */
    @RequestMapping(path = "property/roomInfo/saveRoomInfo",method = {RequestMethod.POST})
    Integer saveRoomInfo(@RequestBody PropertyProjectSaveRoomInfoDTO propertyProjectSaveRoomInfoDTO) throws Exception;


    /**
     * <desc>
     *      修改房屋信息【根据房屋Id（RoomId）】
     * </desc>
     *
     * @param propertyProjectUpdateRoomInfoDTO 修改房屋信息数据传输对象
     * @return  受影响的行数
     * @author LouisLewis
     * @createDate 2017-09-30
     */
    @RequestMapping(path = "property/roomInfo/updateRoomInfo",method = {RequestMethod.POST})
    Integer updateRoomInfo(@RequestBody PropertyProjectUpdateRoomInfoDTO propertyProjectUpdateRoomInfoDTO) throws Exception;


    /**
     * <desc>
     *      根据条件逻辑删除房屋信息
     * </desc>
     *
     * @param propertyProjectRemoveRoomInfoDTO 删除房屋信息数据传输对象
     * @return 受影响的行数
     * @author LouisLewis
     * @createDate 2017-09-30
     */
    @RequestMapping(path = "property/roomInfo/removeRoomInfo",method = {RequestMethod.POST})
    Integer removeRoomInfo(@RequestBody PropertyProjectRemoveRoomInfoDTO propertyProjectRemoveRoomInfoDTO) throws Exception;


    /**
     * <desc>
     *       分页查询房屋信息
     * </desc>
     *
     * @param propertyProjectGetRoomInfoDTO 分页查询房屋信息数据传输对象
     * @return 分页查询结果对象
     * @author LouisLewis
     * @createDate 2017-10-09
     */
    @RequestMapping(path = "property/roomInfo/getPage",method = {RequestMethod.POST})
    Page<PropertyProjectRoomInfoVO> getPage(@RequestBody PropertyProjectGetRoomInfoDTO propertyProjectGetRoomInfoDTO) throws Exception;

    /**
     * <desc>
     *      获取指定单元下的房屋简单信息（房屋id ,房屋名称）列表
     * </desc>
     *
     * @param propertyProjectGetRoomSimpleInfoDTO 查询房屋简单信息（房屋ID，房屋名称）数据传输对象
     * @return 房屋简单信息（房屋id ,房屋名称）列表
     * @author LewisLouis
     * @createDate 2017-10-09
     */
    @RequestMapping(path = "property/roomInfo/getPageRoomSimpleInfo",method = {RequestMethod.POST})
    Page<PropertyProjectRoomSimpleInfoVO> getPageRoomSimpleInfoList(
            @RequestBody PropertyProjectGetRoomSimpleInfoDTO propertyProjectGetRoomSimpleInfoDTO) throws Exception;

    /**
     * <desc>
     *      精确查询，获取单个房屋信息
     * </desc>
     * @param propertyProjectGetRoomInfoDTO 查询房屋信息数据传输对象
     * @return 按创建时间降序排列，首个符合查询条件的房屋信息
     * @author LouisLewis
     * @createDate 2017-10-09
     */
    @RequestMapping(path = "property/roomInfo/getOneRoomInfo",method = {RequestMethod.POST})
    PropertyProjectRoomInfoVO getOneRoomInfo(@RequestBody PropertyProjectGetRoomInfoDTO propertyProjectGetRoomInfoDTO);



    /**
     * <desc>
     *      精确查询，快速获取单个房间简单信息
     * </desc>
     * @param propertyProjectGetRoomInfoDTO 查询房间信息数据传输对象
     * @return 不进行排序，返回首个符合查询条件的房间信息
     * @author LouisLewis
     * @createDate 2018-02-06
     */
    @RequestMapping(path = "property/roomInfo/getOneSimpleRoomInfo",method = {RequestMethod.POST})
    RoomInfoPO getOneSimpleRoomInfo(@RequestBody PropertyProjectGetRoomInfoDTO propertyProjectGetRoomInfoDTO);


    /**
     * <desc>
     *      查询指定单元下的排除部分房间的其它所有房屋简单信息（房屋ID，房号）数据传输对象
     * </desc>
     *
     * @param propertyProjectGetRoomSimpleInfoExcludeIdsDTO 查询指定单元下的排除部分房间的其它所有房屋简单信息（房屋ID，房号）数据传输对象
     * @return 房屋简单信息（房屋id ,房屋名称）列表
     * @createDate 2017-10-24
     */
    @RequestMapping(path = "property/roomInfo/getRoomSimpleInfoExcludeIds",method = {RequestMethod.POST})
    Map<String,Object> getRoomSimpleInfoExcludeIds(@RequestBody PropertyProjectGetRoomSimpleInfoExcludeIdsDTO
                                                           propertyProjectGetRoomSimpleInfoExcludeIdsDTO) throws Exception;



    /**
     * <desc>
     *    获取当前单元楼层下可用的房号和访客呼叫码，用于在添加房屋时提示用户。
     * </desc>
     *
     * @param getMinAvaliableRoomInfoDTO  获取最小可用房号和访客呼叫码查询对象
     * @return 当前单元楼层下可用的房间信息
     * @author LewisLouis
     * @createDate 2018-01-15
     */
    @RequestMapping(path = "property/roomInfo/getMinAvaliableRoomInfo",method = {RequestMethod.POST})
    PropertyProjectMinAvaliableRoomInfoVO getMinAvaliableRoomInfo(
            @RequestBody PropertyProjectGetMinAvaliableRoomInfoDTO getMinAvaliableRoomInfoDTO);

    /**
     * <desc>
     *      查询所有房屋
     * </desc>
     *
     * @param projectId 项目编号
     * @return 项目下所有房屋
     * @author wangzhi
     * @createDate 2019/01/07
     */
    @PostMapping("property/roomInfo/getAllRoomInfoByProjectId")
    List<PropertyProjectRoomInfoVO> getAllRoomInfoByProjectId(@RequestParam("projectId") String projectId) throws Exception;

    /**
     * <desc>
     *    查询房屋列表
     * </desc>
     *
     * @param userId  用户编号
     * @param projectId 项目编号
     * @return 用户的房间信息
     * @author Qiang.S
     * @createDate 2018-11-20
     */
    @RequestMapping(path = "property/roomInfo/myRoomsInfoALL",method = {RequestMethod.POST})
    List<MiniProgramPassRoomListVO> myRoomsInfoALL(@RequestParam("userId")String userId,@RequestParam(value="projectId",required=false)String projectId);

    /**
     * <desc>
     *    查询业主房屋列表
     * </desc>
     *
     * @param userId  用户编号
     * @param projectId 项目编号
     * @return 用户的房间信息
     * @author Qiang.S
     * @createDate 2018-11-20
     */
    @RequestMapping(path = "property/roomInfo/myRoomsInfo",method = {RequestMethod.POST})
    List<MiniProgramPassRoomListVO> myRoomsInfo(@RequestParam("userId")String userId,@RequestParam(value="projectId",required=false)String projectId);

    /**
     * <desc>
     *    根据手机号查询用户UserId
     * </desc>
     *
     * @param phoneNum  手机号
     * @return 用户的userId
     * @author Juguang.S
     * @createDate 2019-04-25
     */
    @RequestMapping(path = "property/roomInfo/getUserIdByPhone",method = {RequestMethod.POST})
    String getUserIdByPhone(@RequestParam("phoneNum")String phoneNum);

    /**
     * <desc>
     *      房屋二维码授权
     * </desc>
     *
     * @return MessageVO 受影响行数
     * @author wangzhi
     * @createDate 2019/09/27
     */
    @RequestMapping(path = "property/roomInfo/qrCodeAuth",method = {RequestMethod.POST})
    Integer qrCodeAuth(@RequestBody PropertyRoomQrCodeAuthDTO propertyRoomQrCodeAuthDTO) throws Exception;

    /**
     * <desc>
     *      获取房间剩余次数
     * </desc>
     *
     * @return MessageVO 受影响行数
     * @author Qiang.S
     * @createDate 2020/07/16
     */
    @RequestMapping(path = "property/roomInfo/getRoomLastCountByRoomId",method = {RequestMethod.POST})
    String getRoomLastCountByRoomId(@RequestParam("roomId")String roomId) throws Exception;

    /**
     * <desc>
     *      共享电梯线下缴费
     * </desc>
     *
     * @param paymentRecordDTO
     * @author Qiang.S
     * @createDate 2020/07/16
     */
    @RequestMapping(path = "property/roomInfo/qrCodeAuthForNew",method = {RequestMethod.POST})
    void qrCodeAuthForNew(@RequestBody PaymentRecordDTO paymentRecordDTO) throws Exception;

    /**
     * <desc>
     *      共享电梯线下退费
     * </desc>
     *
     * @param paymentRecordDTO
     * @author Qiang.S
     * @createDate 2020/07/16
     */
    @RequestMapping(path = "property/roomInfo/outLineRefund",method = {RequestMethod.POST})
    void outLineRefund(@RequestBody PaymentRecordDTO paymentRecordDTO) throws Exception;
}
